layui.use(['element', 'table', 'jquery'], function () {
    var table = layui.table;
    var $ = layui.jquery;
    //获取课程id
    var courseId = localStorage.getItem('courseId');
    $.ajax({
        url: '/course/getCourserRecord',
        type: 'post',
        dataType: 'json',
        data: {'courseId': courseId,'type':2},
        success: function (data) {
            tablereload(data.data);
        }
    });

    function tablereload(data) {
        table.render({
            elem: '#table',
            data: data,
            title: '',
            cols: [[
                {field: 'implementDate', title: '审核时间', align: 'center'},
                {field: 'trueName', title: '审核人员', align: 'center'},
                {
                    field: 'result', title: '审核结果', align: 'center', templet: function (data) {
                        if (data.result == 1) {
                            data.result = "审核通过";
                        } else if (data.result == 2) {
                            data.result = "待审核";
                        } else {
                            data.result = "审核未通过";
                        }
                        return "<div>" + data.result + "</div>";
                    }
                },
                {
                    field: 'remarks', title: '反馈详细', align: 'center', templet: function (data) {
                        if (data.remarks == '') {
                            return "无内容";
                        }
                        return data.remarks;
                    }
                },
            ]]
        });
    }

})